#include <wx/wx.h>

class MyFrame : public wxFrame
{
public:
   MyFrame(const wxString& title);

private:
   void OnPaint(wxPaintEvent& event);
};

MyFrame::MyFrame(const wxString& title)
   : wxFrame(nullptr, wxID_ANY, title)
{
   SetClientSize(400, 400);

   Bind(wxEVT_PAINT, &MyFrame::OnPaint, this);
}

void MyFrame::OnPaint(wxPaintEvent& event)
{
   wxPaintDC dc(this);

   dc.SetPen(wxPen(wxColour(0, 0, 255), 5));
   dc.DrawLine(0, 0, 400, 400);

   dc.DrawCircle(200, 200, 100);
}

class MyApp : public wxApp
{
public:
   virtual bool OnInit();
};

bool MyApp::OnInit()
{
   MyFrame* frame = new MyFrame("21-draw");
   frame->Show();

   return true;
}

wxIMPLEMENT_APP(MyApp);